<!DOCTYPE html>
<html>
#{include file="header.html"}#
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-home"></i>日志管理</h5>
                    <div class="ibox-tools"><a href="?" class="btn btn-xs btn-danger"><i
                            class="fa fa-refresh"></i>刷新</a></div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form id="pagerForm" method="post" class="form-inline">
                            <div class="col-sm-3 m-b-xs">
                                <a class="btn btn-info ajax-get-more"
                                   data-url="#{$smarty.const.ACT}#/sysmanage/SysLog/sys_log_del/"><i
                                        class="fa fa-remove"></i>批量删除</a>
                            </div>
                            <div class="col-sm-9 m-b-xs text-right">
                                <div class="input-group pd-b-5">
                                    <input type="text" name="keywords" placeholder="输入主题关键字搜索" class="form-control">
                                </div>
                                <div class="input-group">
                  <span class="input-group-btn">
                  <button type="button" class="btn btn-primary ajaxSearchForm"><i class="fa fa-search"></i> 搜索</button>
                  </span></div>
                            </div>
                        </form>
                    </div>
                    <table class="table table-hover sorttable 07fly-table" width="100%">
                        <thead>
                        <tr>
                            <th width="22"><input type="checkbox" class="checkboxCtrl"></th>
                            <th width="80">标题</th>
                            <th width="200">内容</th>
                            <th width="50">IP地址</th>
                            <th width="50">操作人</th>
                            <th width="80">时间</th>
                            <th width="50">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                        <tfoot class="ibox-content">
                        <tr>
                            <td colspan="11" align="center"></td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script id="tableListTpl" type="text/html">
    <% for(var i=0;i<list.length;i++) { %>
    <tr>
    <td><input name="id" class="checkboxCtrlId" value="<%=list[i]['id']%>" type="checkbox"></td>
    <td><%=list[i]['title']%></td>
    <td><%=list[i]['content']%></td>
    <td><%=list[i]['ipaddr']%></td>
    <td><%=list[i]['editor']%></td>
    <td><%=list[i]['create_time']%></td>
    <td>
        <p><a href="javascript:void(0)" class="ajax-get"
              data-url="#{$smarty.const.ACT}#/sysmanage/SysLog/sys_log_del/id/<%=list[i]['id']%>/">删除</a></p>
    </td>
    </tr>
    <% } %>
</script>
<script src="#{$smarty.const.APP}#/View/template/js/content.js?v=1.0.0"></script>
<script type="text/javascript">
    var ajaxUrl = '#{$smarty.const.ACT}#/sysmanage/SysLog/sys_log_show_json/';
    $(document).ready(function () {
        turnPage(1);//页面加载时初始化分页

        $("body").on("click", ".batch_operation", function () {
            batch_act = $(this).attr("data-act")
            var chk_value = [];
            $("tbody input[class='checkboxCtrlId']:checked").each(function () {
                chk_value.push($(this).val());
            });
            ids = chk_value.join(",");
            if (batch_act == "del") {
                act_url = "#{$smarty.const.ACT}#/sysmanage/SysLog/sys_log_del/";
                $.ajax({
                    type: "POST",
                    url: act_url,
                    data: {"id": ids},
                    dataType: "json",
                    success: function (data) {
                        if (data.statusCode == '200') {
                            layer.msg('操作成功', {icon: 1});
                            turnPage(1);
                        }
                    },
                    complete: function () {//完成响应
                    }
                });
            }
        });

    });
</script>
</body>


</html>
